home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Products & Services for NeXT
/
Products & Services for NeXT.iso
/
AlembicDemo.app
/
Axone
/
AddIn
/
MesaAddIn.h
< prev
next >
Wrap
Text File
|
1994-03-06
|
12KB
|
304 lines
/**************************************************************************
* *
* *
* This code is copyright (c) 1992 *
* Athena Design, Inc. *
* and David Pollak *
* *
* ALL RIGHTS RESERVED *
* *
* *
* *
* *
* *
**************************************************************************/
int mesaVersion();
char *versionString();
#ifndef LITE
/**************************************************************************
This header file defines the data structures and functions needed to
impliment a function add-in.
**************************************************************************/
#import "MesaError.h"
#import "objc/Object.h"
#import <appkit/View.h>
#import "MesaObjectLibraryInterface.h"
typedef enum {numberAddInValue = 0,stringAddInValue,addressAddInValue,
rangeAddInValue,errorAddInValue} AddInValueType;
typedef struct _AddInValue {
int type;
union {
char *string;
double number;
int error;
struct {
short row1,col1,row2,col2;
void *cells;
} ad;
} values;
} AddInValue;
/*
These functions allow you to push and pop items from the stack
*/
int numberOfItemsOnStack(void *);
void popValueFromStack(void *,AddInValue *);
void pushNumberOnStack(void *,double);
void pushStringOnStack(void *,const char *);
void pushErrorOnStack(void *,int);
void pushAddressOnStack(void *,short,short,void *);
void pushRangeOnStack(void *,short,short,short,short,void *);
/*
These functions allow you to manipulate values
*/
void initAddInValue(AddInValue *);
void freeAddInValue(AddInValue *);
double getAddInValueNumber(AddInValue *,int *);
void getAddInValue(AddInValue *,AddInValue *,int *);
/*
This function allows you to get the value for a cell
*/
int getValueForCell(void *,short,short,int *,AddInValue *);
/*
get the sheet from the information passed
**WARNING - DO NOT USE ANY EVENTADDIN METHOD CALLS FROM WITHIN A FUNCTION ADDIN!!!
*/
id getSheetFromPointer(void *);
void getCurrentAddress(void *,int *,int *);
@interface MesaAddIn : Object
{
}
+ (char *)funcName;
- execute:(void *)stack numberOfParams:(int)num sheet:(void *)sh;
- beginRecalc;
- endRecalc;
@end
@interface Object (MesaAddIn)
+ (int)numFuncs;
+ (char *)funcName:(int)functionNumber;
- execute:(void *)stack numberOfParams:(int)num sheet:(void *)sh funcNumber:(int)fn;
@end
// functions that are useful
void addressToString(int,int,char *); // converts a row and column to a string
int stringToAddress(char *,int *,int *); // converts a string to a row and column ad
int strToRange(char *,int *,int *,int *,int *);
void rangeToString(int,int,int,int,char *);
void freeAMOLIValue(MOLIValue *);
void freeMOLIValues(MOLIValue *,int n);
@interface Object (EventAddIn)
+ (char *)eventName;
- sheetDidOpen:sender;
- sheetWillClose:sender;
- sheetDidClose:sender;
- sheetDidRecalc:sender;
- rangeDidRecalc:sender upperRow:(int)i1 col:(int)i2 lowerRow:(int)i3 col:(int)i4;
- sheetDidRedisplay:sender;
- dataEntered:sender string:(char *)s intoCellRow:(int)i1 col:(int)i2;
- labelTableUpdated:sender;
- sheetWillPrint:sender;
- sheetDidPrint:sender;
- pageWillPrint:sender page:(int)pn of:(int)of pageRect:(NXRect *)pr viewRect:(NXRect *)vr;
- rangeCleared:sender upperRow:(int)i1 col:(int)i2 lowerRow:(int)i3 col:(int)i4;
- sheetSizeChanged:sender toWidth:(int)w height:(int)h;
- rangeSelected:sender upperRow:(int)i2 col:(int)i2 lowerRow:(int)i3 col:(int)i4;
- doubleClick:sender onCellRow:(int)i1 col:(int)i2;
- rangeFormatChanged:sender upperRow:(int)i1 col:(int)i2 lowerRow:(int)i3 col:(int)i4;
- rangeCopied:sender fromUpperRow:(int)i1 col:(int)i2 lowerRow:(int)i3 col:(int)i4
toUpperRow:(int)i5 col:(int)i6 lowerRow:(int)i7 col:(int)i8;
- rangeMoved:sender fromUpperRow:(int)i1 col:(int)i2 lowerRow:(int)i3 col:(int)i4
toUpperRow:(int)i5 col:(int)i6 lowerRow:(int)i7 col:(int)i8;
- baseFormatChanged:sender;
- addInScriptChanged:sender;
// rev 110
- sheetBecameTop:sender;
- sheetResignedTop:sender;
- (const char *)next:(const char *)s;
// rev 162
- (int)scriptFunc:(AddInValue *)aiv num:(int)nv return:(AddInValue *)airet sheet:sheet;
@end
@interface Object (Sheet)
- setPathName:(char *)s;
- (int)totalRows;
- (int)totalColumns;
- (char *)sheetTitle;
- save:sender;
- saveAs:sender;
- doRecalc;
- (int) numberOfLabels;
- (char *)getLabelNumber:(int)n;
- deleteLabel:(char *)s;
- redrawAll;
- associateLabel:(char *)label with:(char **)tags and:(void *)mv num:(int)num
offset:(int)offset orientation:(int)orient;
- performQuery:(char *)q;
- (char *)getEventHeader:(char *)name;
- setEventHeader:(char *)en forAddIn:(char *)ai;
- updateDataEntry;
- setChanged:(BOOL)b;
- (BOOL)changed;
- (int)numQueries;
- (char *)nameOfQuery:(int)n;
- performQuery:(char *)s;
- (int)numReports;
- (char *)getReportNumber:(int)n;
- printReport:(char *)s;
- setRowSize:(int)size fromRow:(int)from to:(int)to;
- setColSize:(int)size fromCol:(int)from to:(int)to;
- setBestColSizeFrom:(int)from to:(int)to;
- setBestRowSizeFrom:(int)from to:(int)to;
- resetRowSizeFrom:(int)from to:(int)to;
- resetColSizeFrom:(int)from to:(int)to;
- (char *)getCellStringRow:(int)row col:(int)col;
- setCellString:(char *)s row:(int)row col:(int)col;
- setRangeUpperRow:(int)ur col:(int)uc lowerRow:(int)lr col:(int)lc toColor:(NXColor)c;
- setRangeUpperRow:(int)ur col:(int)uc lowerRow:(int)lr col:(int)lc toAltColor:(NXColor)c;
- setRangeUpperRow:(int)ur col:(int)uc lowerRow:(int)lr col:(int)lc toBkgColor:(NXColor)c;
- setRangeUpperRow:(int)ur col:(int)uc lowerRow:(int)lr col:(int)lc toBorderColor:(NXColor)c;
- setRangeUpperRow:(int)ur col:(int)uc lowerRow:(int)lr col:(int)lc toDefaultTextColor:(int)c;
- setRangeUpperRow:(int)ur col:(int)uc lowerRow:(int)lr col:(int)lc toDefaultBkg:(int)c;
- setRangeUpperRow:(int)ur col:(int)uc lowerRow:(int)lr col:(int)lc toDefaultAltColor:(int)c;
- setRangeUpperRow:(int)ur col:(int)uc lowerRow:(int)lr col:(int)lc toDefaultBorderColor:(int)c;
- setRangeUpperRow:(int)ur col:(int)uc lowerRow:(int)lr col:(int)lc toDefaultFont:(int)c;
- setRangeUpperRow:(int)ur col:(int)uc lowerRow:(int)lr col:(int)lc toDefaultBorder:(int)c;
- setRangeUpperRow:(int)ur col:(int)uc lowerRow:(int)lr col:(int)lc toDefaultAlignment:(int)c;
- setRangeUpperRow:(int)ur col:(int)uc lowerRow:(int)lr col:(int)lc toDefaultDisplayFormat:(int)c;
- setRangeUpperRow:(int)ur col:(int)uc lowerRow:(int)lr col:(int)lc toAlignment:(int)c;
- setRangeUpperRow:(int)ur col:(int)uc lowerRow:(int)lr col:(int)lc toBaseFormat:(int)c;
- setRangeUpperRow:(int)ur col:(int)uc lowerRow:(int)lr col:(int)lc toPrecision:(int)c;
- setRangeUpperRow:(int)ur col:(int)uc lowerRow:(int)lr col:(int)lc toDisplayFormat:(int)c;
- setRangeUpperRow:(int)ur col:(int)uc lowerRow:(int)lr col:(int)lc toBorder:(int)c;
- setRangeUpperRow:(int)ur col:(int)uc lowerRow:(int)lr col:(int)lc toTopBorder:(int)c;
- setRangeUpperRow:(int)ur col:(int)uc lowerRow:(int)lr col:(int)lc toBottomBorder:(int)c;
- setRangeUpperRow:(int)ur col:(int)uc lowerRow:(int)lr col:(int)lc toLeftBorder:(int)c;
- setRangeUpperRow:(int)ur col:(int)uc lowerRow:(int)lr col:(int)lc toRightBorder:(int)c;
- setRangeUpperRow:(int)ur col:(int)uc lowerRow:(int)lr col:(int)lc toWrap:(int)c;
- setRangeUpperRow:(int)ur col:(int)uc lowerRow:(int)lr col:(int)lc toBaseline:(int)c;
- setRangeUpperRow:(int)ur col:(int)uc lowerRow:(int)lr col:(int)lc toFont:font;
- setRangeUpperRow:(int)ur col:(int)uc lowerRow:(int)lr col:(int)lc toHasBkgColor:(int)c;
- setRangeUpperRow:(int)ur col:(int)uc lowerRow:(int)lr col:(int)lc toMode:(int)c;
- (char *)createGraphWithRect:(NXRect *)re type:(int)type upperRow:(int)ur col:(int)uc
lowerRow:(int)lr col:(int)lc;
- (BOOL)findLabel:(char *)s upperRow:(int *)ur col:(int *)uc lowerRow:(int *)lr col:(int *)lc;
- addLabel:(char *)s upperRow:(int)ur col:(int)uc lowerRow:(int)lr col:(int)lc;
- moveRangeUpperRow:(int)sur col:(int)suc lowerRow:(int)slr col:(int)slc
toUpperRow:(int)dur col:(int)duc lowerRow:(int)dlr col:(int)dlc;
- copyRangeUpperRow:(int)sur col:(int)suc lowerRow:(int)slr col:(int)slc
toUpperRow:(int)dur col:(int)duc lowerRow:(int)dlr col:(int)dlc;
- associateRangeUpperRow:(int)ur col:(int)uc lowerRow:(int)lr col:(int)lc with:(char **)tags
and:(void *)mv num:(int)num offset:(int)offset orientation:(int)orient;
- getMOLIValue:(void *)mv row:(int)row col:(int)col;
- getMOLIValues:(void **)mv num:(int *)n upperRow:(int)ur col:(int)uc
lowerRow:(int)lr col:(int)lc;
- putMOLIValues:(void *)mv num:(int)n upperRow:(int)ur col:(int)uc
lowerRow:(int)lr col:(int)lc;
- putMOLIValue:(void *)mv row:(int)r col:(int)c;
// rev 110
- currentRangeUpperRow:(int *)ur col:(int *)uc lowerRow:(int *)lr col:(int *)lc;
- setRangeToDefaultsUpperRow:(int)ur col:(int)uc lowerRow:(int)lr col:(int)lc;
// rev 141
- recalcRangeUpperRow:(int)ur andCol:(int)uc lowerRow:(int)lr andCol:(int)lc;
// rev 145
- deleteScript:(char *)s;
- (int)numScripts;
- (char *)nameOfScript:(int)n;
- runScript:(char *)s;
- setGridNXColor:(NXColor)nc;
- setBkgNXColor:(NXColor)nc;
- setGrid:(int)go;
- setClearBkg:(int)cb;
- setRowHeight:(int)rh;
- setColWidth:(int)cw;
- setAutoRecalcOn:(int)ar;
- setMaxNumberOfRows:(int)nr;
- setMaxNumberOfColumns:(int)nc;
- miniturizeWindow:(int)win;
// rev 162
- (NXColor)getTheGraphColor:(char *)graph item:(int)it;
- setTheGraph:(char *)graph item:(int)it color:(NXColor)nc;
- (NXColor)getTheGraphColor:(char *)graph element:(int)it;
- setTheGraph:(char *)graph element:(int)it color:(NXColor)nc;
- (int)getTheGraphInt:(char *)graph item:(int)it ;
- setTheGraph:(char *)graph item:(int)it intValue:(int)iv;
- (char *)getTheGraphString:(char *)graph item:(int)it ;
- setTheGraph:(char *)graph item:(int)it stringVal:(char *)sv;
- (double)getTheGraphDouble:(char *)graph item:(int)it;
- setTheGraph:(char *)graph item:(int)it doubleVal:(double)dv;
- getTheGraphFont:(char *)graph item:(int)it ;
- setTheGraph:(char *)graph item:(int)it font:fv;
- getTheGraphRange:(char *)graph item:(int)it range:(int *)ur :(int *)uc :(int *)lr :(int *)lc;
- setTheGraph:(char *)graph item:(int)it range:(int)ur :(int)uc :(int)lr :(int)lc;
// rev 163
- setRangeUpperRow:(int)ur col:(int)uc lowerRow:(int)lr col:(int)lc toUnderline:(int)ul;
- setRangeUpperRow:(int)ur col:(int)uc lowerRow:(int)lr col:(int)lc toDefaultUnderline:(int)ul;
@end
@interface Object (DPApplication)
- getOpenSheets;
- openMesaFile:(const char *)path;
- newWorksheet;
- addMenuItem:(char *)name target:target action:(SEL)action;
- removeMenuItem:item;
// rev 109+
- setSubmenu:myMenu forItem:myItem;
// rev 110+
- topSheet;
// rev 136
- (const char *)pathToAddin:sender;
@end
#define nullSQLValue -1
#define numberSQLValue 1
#define stringSQLValue 2
#define dateSQLValue 3
#define noMoreSQLResults 2
#define SQLSucceeded 1
#define SQLFailed 0
#define moreSQLRows -1
#define noMoreSQLRows -2
#define regSQLRow moreSQLRows
#endif